﻿using Kingdee.BOS.App;
using Kingdee.BOS.App.Data;
using Kingdee.BOS.Contracts;
using Kingdee.BOS.Core.Bill.PlugIn;
using Kingdee.BOS.Core.DynamicForm.PlugIn.Args;
using Kingdee.BOS.Core.Metadata;
using Kingdee.BOS.Core.Report;
using Kingdee.BOS.Core.SqlBuilder;
using Kingdee.BOS.Model.ReportFilter;
using Kingdee.BOS.Orm.DataEntity;
using Kingdee.BOS.ServiceHelper;
using Kingdee.BOS.Util;
using System;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Text;

namespace LM.CB.K3Cloud.Plugin
{
    /// <summary>
    /// 产品bom设置
    /// </summary>
    /// <remarks>
    /// 功能：1.点击”获取标准bom“后，从物料清单树形查询中获取产品标准bom
    /// 创建人：lxl
    /// 创建日期：2024-06-14
    /// </remarks>
    [Description("产品bom表单插件")]
    [Kingdee.BOS.Util.HotUpdate]
    public class ProductBOMBillPlugin : AbstractBillPlugIn
    {
        // private string[] TEMP_TABLE_NAME_LIST; //创建临时表使用
        private readonly IDBService DBSERVICE = ServiceHelper.GetService<IDBService>();
        public override void BarItemClick(BarItemClickEventArgs e)
        {
            switch (e.BarItemKey.ToUpperInvariant())
            {
                //case "SAVE": 表单定义的事件都可以在这里执行，需要通过事件的代码[大写]区分不同事件
                //break;
                case "QLTK_BTGET"://点击获取数据按钮
                    SetData();
                    break;
                default:
                    break;
            }
        }

        /// 获取产品标准bom
        ///
        private void SetData()
        {
            this.View.Model.DeleteEntryData("FEntity");
            
            this.View.UpdateView("FEntity");
        }
   
        
    }
}
